﻿
<!-- aca programar como form para registrar pago.. -->
<script>
    $(document).on("mobileinit", function () {
        $.mobile.autoInitializePage = false;
        $.mobile.hashListeningEnabled = false;
    });

    function mobileInitPage() {
        $.mobile.hashListeningEnabled = true;
        $.mobile.initializePage();
    };
  </script>
<script>

    /*** code gen by capture-photo  ***/
    $(document).on("gkComponentsReady", function () {
        $("#btnGetCamara").on("click", function () {
            if (navigator.camera) {
                navigator.camera.getPicture(
                  // Called when a photo is successfully retrieved
                  function (imgURI) {
                      // Set image use DATA_URL

                      //imgURI = "data:image/jpeg;base64,"+imgURI;
                      $("#txtImg").attr("src", imgURI);
                  },
                  // Called if something bad happens
                  function (msg) {
                      alert("Failed because: " + msg);
                  },
                  // Camera options
                  {
                      quality: 80,
                      destinationType: navigator.camera.DestinationType.DATA_URL, 
                      destinationType: navigator.camera.DestinationType.FILE_URI,
                      sourceType: Camera.PictureSourceType.CAMERA,
                      encodingType: Camera.EncodingType.JPEG,
                      saveToPhotoAlbum: true
                  });
            }
        });
    });
  </script>


<!-- Finc codigo para camara -->    

<div id="regitrarPagoView" 
     data-role="view" 
     data-title="Registrar Pago" 
     data-layout="mainLayout"
     data-model="BoxSportSystem.proveedorDestails.viewModel"
     data-show="BoxSportSystem.proveedorDestails.onShow">
        
        <header data-role="header">
            <div data-role="navbar">
                <a class="nav-button" data-align="left"
                     data-role="backbutton">Atras</a>
                <span data-role="view-title"></span>
            </div>
        </header>

    <ul data-role="listview" data-style="inset" >                   
        <li><h2><span data-bind="text: proveedor.NombreEmpresa"/></h2></li>
        <li>RUC: <span data-bind="text: proveedor.RucProvedor"/></li>

        <li><input id="iPro" data-bind="value: proveedor.Id" /></li>
        <li><label for="fFecha">Fecha:</label><input id="fFecha" data-role="datepicker" data-bind="value: Pagos.FechaPago" /></li>
        <li><label for="lImg">Imagen:</label><input id="lImg" data-bind="value: Pagos.ImagenPago" /></li>
        <li><button data-role="button" data-icon="add" data-bind="click: save ">Guardar  </button></li>
        <li>
            <button id="btnGetCamara" data-role="button"  data-icon="play">Camara</button><br/>
        </li>
                
        <li>            
            <img id="txtImg" style="width:50%;" src="http://jqmdesigner.appspot.com/images/image.png" is="dragable">
            <!--<img style="display:none;width:140px;height:140px;" id="imagen" src="" />-->  
        </li>
    </ul>
    </div>